var express = require('express');
var router = express.Router();

var http = require("http");
var request = require("request");


/** 官网**/
var gameCodeList = require("./h5/gameCode.json");
router.get("/gamePortal/getAllAvailable",function(req,res,next){
    res.json(gameCodeList);
})


var seriesList = require("./h5/seriesList.json");
router.get("/guess/getMatchTypeListByRoundType",function(req,res,next) {
    res.json(seriesList);
})

var seriesDetail = require("./h5/seriesDetail.json");
router.get("/guess/getAllSeriesCompetitionList",function(req,res,next){
    res.json(seriesDetail);
})


//游戏类型
router.get("/getAllAvailable",function(req,res,next){
    res.json({
        code:200,
        data:[
            {code:"lol",gameName:"LOL",imgPath:"http://game2.1332255.com:80/group1/M00/00/10/Cj2sWVhvC_qAVX0DAAAIqvsxHVs276.png",isAvailable:1,sort:1},
            {code:"dota2",gameName:"dota2",imgPath:"http://game2.1332255.com:80/group1/M00/00/0C/Cj2sWVhlwhqAW-i2AAAJSgEnLj0923.png",isAvailable:1,sort:2}
        ]
    })
})


/** 一比分内嵌**/
var ares = require("./bifen/area.json");
router.get("/matchArea/findAll",function(req,res,next){
    res.json(ares);
})
var swiperImg = require("./bifen/matchs.json");
router.get("/lol/matchType/query/0",function(req,res,next){
    res.json(swiperImg);
})
var match1 = require("./bifen/match1.json");
router.get("/lol/matchType/query/1",function(req,res,next){
    res.json(match1);
})
var match2 = require("./bifen/match2.json");
router.get("/lol/matchType/query/2",function(req,res,next){
    res.json(match2);
})
var match3 = require("./bifen/match3.json");
router.get("/lol/matchType/query/3",function(req,res,next){
    res.json(match3);
})
var match4 = require("./bifen/match4.json");
router.get("/lol/matchType/query/4",function(req,res,next){
    res.json(match4);
})
var match5 = require("./bifen/match5.json");
router.get("/lol/matchType/query/5",function(req,res,next){
    res.json(match5);
})


var dotas = require("./bifen/dotaMatchs.json");
router.get("/dota/matchType/query/0",function(req,res,next){
    res.json(dotas);
})
var dotas3 = require("./bifen/dotaMatchs3.json");
router.get("/dota/matchType/query/3",function(req,res,next){
    res.json(dotas3);
})



var teams = require("./bifen/teams.json");
var lolTeam0 = require("./bifen/lolTeam0.json");
var lolTeam1 = require("./bifen/lolTeam1.json");
var lolTeam3 = require("./bifen/lolTeam3.json");
var lolTeam4 = require("./bifen/lolTeam4.json");
var lolTeam5 = require("./bifen/lolTeam5.json");
var lolTeam6 = require("./bifen/lolTeam6.json");
router.get("/lol/team/list-for-db",function(req,res,next){
    var matchAreaId = 0;
    var gameCode = "lol";
    var pageIndex = 1
    var pageSize = 11
    var orderColumn = "";
    var order = "ASC"
    var type = req.query.matchAreaId || "0" ; //1.  英雄联盟, 2. dota2, 3.s炉石传说.   ? id.

    if (type === "0") {
        res.json(teams);
    } else if (type == "1") {

    }
    res.json(teams);
})


var talent = require("./bifen/talent.json");
router.get("/talent",function(req,res,next){
    var id = req.query.id || 0 ;
    console.log(id);
    res.json(talent);
})
module.exports = router;